package com.hkf.shop.service.serviceImpl;

import com.hkf.shop.mapper.UserMapper;
import com.hkf.shop.service.UserService;
import com.yyds.shop.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author huangkf
 * @version 1.0
 * @date 2022/12/16:10:42
 * @description 用户业务接口实现类
 */

@Service
public class UserServiceImpl implements UserService {


    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAllUser() {

        List<User> allUser = userMapper.findAllUser();

        return allUser;
    }

    @Override
    public User findById(String id) {
        User byId = userMapper.findById(id);
        return byId;
    }

    @Override
    public boolean addUser(User user) {
        boolean b = userMapper.addUser(user);

        return b;
    }

    @Override
    public boolean deleteUser(String id) {

        boolean b = userMapper.deleteUser(id);
        return b;
    }
}
